package jude.java.money.task;

public class TaskContext {

	private static ThreadLocal<TaskDetails> details = new ThreadLocal<TaskDetails>();
	
	public static TaskDetails get() {
		return details.get();
	}
	
	public static void set(TaskDetails d) {
		details.set(d);
	}
	
	public static void signal(int position) {
		TaskDetails d = details.get();
		if (d != null) {
			d.signal(position);
		}
	}
	
	public static void signal(int position, String desc) {
		TaskDetails d = details.get();
		if (d != null) {
			d.signal(position, desc);
		}
	}

	public static void setDetail(String detail) {
		TaskDetails d = details.get();
		if (d != null) {
			d.setDetail(detail);
		}
	}
	
	public static void setCategory(String category) {
		TaskDetails d = details.get();
		if (d != null) {
			d.setCategory(category);
		}
	}
	
	public static void setDesc(String desc) {
		TaskDetails d = details.get();
		if (d != null) {
			d.setDesc(desc);
		}
	}
}
